"""

"""

class Phone:
    def __init__(self,power=100):
        self.__power = power
    # 打电话  听歌  玩游戏
    def haodian(self,type,diaoDianLiang):
        self.__power-=diaoDianLiang
        return f"{type}每次消耗电量{diaoDianLiang}"
    def chongDian(self,dianLiang):
       if  self.__power+dianLiang >100:
           self.__power=100
           print(self.__power)
       else:
           self.__power += dianLiang
           print(self.__power)


p1=Phone()

p1.haodian("玩游戏",10)
p1.haodian("听歌",5)
p1.haodian("听歌",5)
p1.haodian("听歌",5)
p1.haodian("打电话",4)
p1.haodian("结电话",3)
p1.chongDian(20)




